module.exports = {
  ClearHeightAndWidth() {
    wx.removeStorageSync('windowHeight')
    wx.removeStorageSync('windowWidth')
  },
  ClearSearchTop() {
    wx.removeStorageSync('searchTop')
  },
  ClearOrderTopHeight() {
    wx.removeStorageSync('orderTopHeight')
  },
  // 清除token
  ClearUserToken() {
    wx.request({
      url: 'http://localhost:8089/clear',
      method: "GET",
      data: {
        token: wx.getStorageSync('token')
      }
    })
    //清除小程序缓存
    wx.removeStorageSync('token')
  },
  //查询token有效期
  QueryKeyExpire() {
    if (wx.getStorageSync('token')!="") {
      console.log("进入Token过期插叙API")
      wx.request({
        url: 'http://localhost:8089/getExpireTime',
        method: "GET",
        data: {
          token: wx.getStorageSync('token')
        },
        success(res) {
          wx.setStorageSync('tokenExpire', res.data)
        }
      })
    }

  }
}